Skip to content

Conversation

@yusuf601
Copy link
Member

@yusuf601 yusuf601 commented Sep 9, 2025

feat: Judul Perubahan

Menambahkan Method Swap pada stack array

void swap(Stack& others){
    //tukar capacity
    std::size_t tempCapa = capacity;
    capacity = others.size;
    others.size = tempCapa;
    //tukar size
    int tempSize = size;
    size = others.size;
    others.size = tempSize;
    //tukar array
    type* temp = new type[capacity];
    temp = arr;
    arr = others.arr;
    others.arr = temp; 
}

Checklist

Umum:
  • [ x] Saya menambah algoritma terbaru.
  • [x ] Saya menambah dokumentasi.
Contributor Requirements (Syarat Kontributor) dan Lain-Lain:
  • [ x] Saya telah menambahkan komentar kode yang memberikan penjelasan maksud dari kode yang saya buat.
  • [ x] Saya menggunakan bahasa Indonesia untuk memberikan penjelasan dari kode yang saya buat.

Environment

Saya menggunakan (I'm using):

  • OS = linux
  • g++ = 15.2.1

Link Issues

Issues: #


License

This Commit License
https://github.com/Build-X-From-Scratch/Stack_Scratch/blob/main/LICENSE

@yusuf601 yusuf601 requested review from a team, Nabila224 and aaaskyyyy September 9, 2025 01:22
@yusuf601 yusuf601 merged commit d51691a into Build-X-From-Scratch:main Sep 9, 2025
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants